home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 June: Technology Seed / June 98 ADC Seed.toast / Mac OS 8.5a8 Pseudo SDK / interfaces-and-libraries / CIncludes / Finder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-19  |  6.6 KB  |  220 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Finder.h
  3.  
  4.      Contains:    Finder flags and container types.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __FINDER__
  19. #define __FINDER__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __EVENTS__
  28. #include <Events.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53.  
  54. enum {
  55.     kCustomIconResource            = -16455                        /* Custom icon family resource ID */
  56. };
  57.  
  58.  
  59. enum {
  60.     kContainerFolderAliasType    = FOUR_CHAR_CODE('fdrp'),        /* type for folder aliases */
  61.     kContainerTrashAliasType    = FOUR_CHAR_CODE('trsh'),        /* type for trash folder aliases */
  62.     kContainerHardDiskAliasType    = FOUR_CHAR_CODE('hdsk'),        /* type for hard disk aliases */
  63.     kContainerFloppyAliasType    = FOUR_CHAR_CODE('flpy'),        /* type for floppy aliases */
  64.     kContainerServerAliasType    = FOUR_CHAR_CODE('srvr'),        /* type for server aliases */
  65.     kApplicationAliasType        = FOUR_CHAR_CODE('adrp'),        /* type for application aliases */
  66.     kContainerAliasType            = FOUR_CHAR_CODE('drop'),        /* type for all other containers */
  67.     kDesktopPrinterAliasType    = FOUR_CHAR_CODE('dtpa'),        /* type for Desktop Printer alias */
  68.     kContainerCDROMAliasType    = FOUR_CHAR_CODE('cddr'),        /* type for CD-ROM alias */
  69.                                                                 /* types for Special folder aliases */
  70.     kSystemFolderAliasType        = FOUR_CHAR_CODE('fasy'),
  71.     kAppleMenuFolderAliasType    = FOUR_CHAR_CODE('faam'),
  72.     kStartupFolderAliasType        = FOUR_CHAR_CODE('fast'),
  73.     kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn'),
  74.     kPreferencesFolderAliasType    = FOUR_CHAR_CODE('fapf'),
  75.     kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact'),
  76.     kExtensionFolderAliasType    = FOUR_CHAR_CODE('faex'),        /* types for AppleShare folder aliases */
  77.     kExportedFolderAliasType    = FOUR_CHAR_CODE('faet'),
  78.     kDropFolderAliasType        = FOUR_CHAR_CODE('fadr'),
  79.     kSharedFolderAliasType        = FOUR_CHAR_CODE('fash'),
  80.     kMountedFolderAliasType        = FOUR_CHAR_CODE('famn')
  81. };
  82.  
  83.  
  84. enum {
  85.                                                                 /* Finder Flags */
  86.     kIsOnDesk                    = 0x0001,
  87.     kColor                        = 0x000E,
  88.     kIsShared                    = 0x0040,                        /* bit 0x0080 is hasNoINITS */
  89.     kHasBeenInited                = 0x0100,                        /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use */
  90.     kHasCustomIcon                = 0x0400,
  91.     kIsStationery                = 0x0800,
  92.     kNameLocked                    = 0x1000,
  93.     kHasBundle                    = 0x2000,
  94.     kIsInvisible                = 0x4000,
  95.     fInvisible                    = kIsInvisible,                    /* old name of kIsInvisible Finder flag */
  96.     kIsAlias                    = 0x8000
  97. };
  98.  
  99. #if OLDROUTINENAMES
  100.  
  101. enum {
  102.     kIsStationary                = kIsStationery
  103. };
  104.  
  105. #endif  /* OLDROUTINENAMES */
  106.  
  107. /*    
  108.     The following declerations used to be in Files.≈, 
  109.     but are Finder specific and were moved here.
  110. */
  111.  
  112. enum {
  113.                                                                 /* Finder Constants */
  114.     fOnDesk                        = 1,
  115.     fHasBundle                    = 8192,
  116.     fTrash                        = -3,
  117.     fDesktop                    = -2,
  118.     fDisk                        = 0
  119. };
  120.  
  121.  
  122. struct FInfo {
  123.     OSType                             fdType;                        /*the type of the file*/
  124.     OSType                             fdCreator;                    /*file's creator*/
  125.     unsigned short                     fdFlags;                    /*flags ex. hasbundle,invisible,locked, etc.*/
  126.     Point                             fdLocation;                    /*file's location in folder*/
  127.     short                             fdFldr;                        /*folder containing file*/
  128. };
  129. typedef struct FInfo                    FInfo;
  130.  
  131. struct FXInfo {
  132.     short                             fdIconID;                    /*Icon ID*/
  133.     short                             fdUnused[3];                /*unused but reserved 6 bytes*/
  134.     SInt8                             fdScript;                    /*Script flag and number*/
  135.     SInt8                             fdXFlags;                    /*More flag bits*/
  136.     short                             fdComment;                    /*Comment ID*/
  137.     long                             fdPutAway;                    /*Home Dir ID*/
  138. };
  139. typedef struct FXInfo                    FXInfo;
  140.  
  141. struct DInfo {
  142.     Rect                             frRect;                        /*folder rect*/
  143.     unsigned short                     frFlags;                    /*Flags*/
  144.     Point                             frLocation;                    /*folder location*/
  145.     short                             frView;                        /*folder view*/
  146. };
  147. typedef struct DInfo                    DInfo;
  148.  
  149. struct DXInfo {
  150.     Point                             frScroll;                    /*scroll position*/
  151.     long                             frOpenChain;                /*DirID chain of open folders*/
  152.     SInt8                             frScript;                    /*Script flag and number*/
  153.     SInt8                             frXFlags;                    /*More flag bits*/
  154.     short                             frComment;                    /*comment*/
  155.     long                             frPutAway;                    /*DirID*/
  156. };
  157. typedef struct DXInfo                    DXInfo;
  158.  
  159. /* Values of the 'message' parameter to a Control Panel 'cdev' */
  160.  
  161. enum {
  162.     initDev                        = 0,                            /*Time for cdev to initialize itself*/
  163.     hitDev                        = 1,                            /*Hit on one of my items*/
  164.     closeDev                    = 2,                            /*Close yourself*/
  165.     nulDev                        = 3,                            /*Null event*/
  166.     updateDev                    = 4,                            /*Update event*/
  167.     activDev                    = 5,                            /*Activate event*/
  168.     deactivDev                    = 6,                            /*Deactivate event*/
  169.     keyEvtDev                    = 7,                            /*Key down/auto key*/
  170.     macDev                        = 8,                            /*Decide whether or not to show up*/
  171.     undoDev                        = 9,
  172.     cutDev                        = 10,
  173.     copyDev                        = 11,
  174.     pasteDev                    = 12,
  175.     clearDev                    = 13,
  176.     cursorDev                    = 14
  177. };
  178.  
  179.  
  180. /* Special values a Control Panel 'cdev' can return */
  181.  
  182. enum {
  183.     cdevGenErr                    = -1,                            /*General error; gray cdev w/o alert*/
  184.     cdevMemErr                    = 0,                            /*Memory shortfall; alert user please*/
  185.     cdevResErr                    = 1,                            /*Couldn't get a needed resource; alert*/
  186.     cdevUnset                    = 3                                /* cdevValue is initialized to this*/
  187. };
  188.  
  189. /* Control Panel Default Proc */
  190. typedef CALLBACK_API( long , ControlPanelDefProcPtr )(short message, short item, short numItems, short cPanelID, EventRecord *theEvent, long cdevValue, DialogPtr cpDialog);
  191. typedef STACK_UPP_TYPE(ControlPanelDefProcPtr)                     ControlPanelDefUPP;
  192. enum { uppControlPanelDefProcInfo = 0x000FEAB0 };                 /* pascal 4_bytes Func(2_bytes, 2_bytes, 2_bytes, 2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  193. #define NewControlPanelDefProc(userRoutine)                     (ControlPanelDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlPanelDefProcInfo, GetCurrentArchitecture())
  194. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppControlPanelDefProcInfo, (message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  195.  
  196.  
  197.  
  198.  
  199.  
  200. #if PRAGMA_STRUCT_ALIGN
  201.     #pragma options align=reset
  202. #elif PRAGMA_STRUCT_PACKPUSH
  203.     #pragma pack(pop)
  204. #elif PRAGMA_STRUCT_PACK
  205.     #pragma pack()
  206. #endif
  207.  
  208. #ifdef PRAGMA_IMPORT_OFF
  209. #pragma import off
  210. #elif PRAGMA_IMPORT
  211. #pragma import reset
  212. #endif
  213.  
  214. #ifdef __cplusplus
  215. }
  216. #endif
  217.  
  218. #endif /* __FINDER__ */
  219.  
  220.